import { View } from "../../../../mvc/core/View";
import { GTextFormat } from "../../../../common/GTextFormat";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { Language } from "../../../../../extend/language/Language";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
type int = number;
//class MountAttrPanel
    
    export  class MountAttrPanel extends View
    {
        constructor(arg1: Array<any>=null, arg2: GTextFormat=null, arg3: GTextFormat=null, arg4: GTextFormat=null)
        {
            super();
            this._attrTxtArray = [];
            this._attrAddTxtArray = [];
            this._attrLabelTxtArray = [];
            this._raiseArray = [];
            this._attrLabelArray = arg1;
            this._labelTextFormat = arg3 != null ? arg3 : GlobalStyle.textFormat1;
            this._valueTextFormat = arg4 != null ? arg4 : GlobalStyle.textFormat2;
            this._addTextFormat = arg2;
            this.init();
            return;
        }

        public updateStarLevel(arg1: int): void
        {
            this._cLevelTxt.text = Language.getStringByParam(71505, arg1);
            return;
        }

        /* internal  */init(): void
        {
            var loc2=null;
            var loc3=null;
            var loc4=null;
            var loc5=null;
            this._cLevelTxt = ObjCreate.createGTextField(Language.getStringByParam(71505, 1), 0, 0, 70, 20, this, GlobalStyle.textFormat6);
            this._cLevelTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            var loc1="";
            var loc6=0;
            while (loc6 < this._attrLabelArray.length) 
            {
                loc1 = this._attrLabelArray[loc6];
                loc2 = ObjCreate.createGTextField(loc1, 0, 25 + loc6 * 20, 70, 20, this, this._labelTextFormat);
                loc2.autoSize = flash.text.TextFieldAutoSize.LEFT;
                loc3 = ObjCreate.createTextField("", 60, 25 + loc6 * 20, 160, 20, this, this._valueTextFormat);
                loc3.autoSize = flash.text.TextFieldAutoSize.LEFT;
                (loc5 = ObjCreate.createBitmap(ImagesConst.RangeRaise, 95, 25 + loc6 * 20, this)).visible = false;
                this._raiseArray.push(loc5);
                (loc4 = ObjCreate.createTextField("", 115, 25 + loc6 * 20, 160, 20, this, this._addTextFormat)).autoSize = flash.text.TextFieldAutoSize.LEFT;
                loc4.visible = true;
                this._attrLabelTxtArray.push(loc2);
                this._attrTxtArray.push(loc3);
                this._attrAddTxtArray.push(loc4);
                ++loc6;
            }
            return;
        }

        public updateValue(arg1: Array<any>): void
        {
            var loc1=null;
            var loc2=0;
            while (loc2 < this._attrTxtArray.length) 
            {
                loc1 = this._attrTxtArray[loc2] as Object /* flash.text.TextField */;
                loc1.text = arg1[loc2].toString();
                ++loc2;
            }
            return;
        }

        public updateAddValue(arg1: Array<any>): void
        {
            var loc1=null;
            var loc2=0;
            var loc3=null;
            var loc4=0;
            while (loc4 < this._attrAddTxtArray.length) 
            {
                loc1 = this._attrAddTxtArray[loc4] as Object /* flash.text.TextField */;
                loc2 = arg1[loc4] as int;
                loc1.text = loc2.toString();
                loc3 = this._raiseArray[loc4] as Object /* flash.display.Bitmap */;
                loc1.visible = loc2 > 0 ? true : false;
                loc3.visible = loc2 > 0 ? true : false;
                ++loc4;
            }
            return;
        }

        public regLabelTip(arg1: Array<any>): void
        {
            var loc1=null;
            var loc2=0;
            while (loc2 < this._attrLabelTxtArray.length) 
            {
                loc1 = this._attrLabelTxtArray[loc2] as GTextFiled;
                loc1.toolTipData = arg1[loc2].toString();
                ++loc2;
            }
            return;
        }

        public clear(): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            while (loc3 < this._attrTxtArray.length) 
            {
                loc1 = this._attrTxtArray[loc3] as Object /* flash.text.TextField */;
                loc1.text = "";
                loc2 = this._attrAddTxtArray[loc3] as Object /* flash.text.TextField */;
                loc2.text = "";
                ++loc3;
            }
            this._cLevelTxt.text = "";
            return;
        }

        /* internal */ /* var */_cLevelTxt: GTextFiled;

        /* internal */ /* var */_attrLabelArray: Array<any>;

        /* internal */ /* var */_attrTxtArray: Array<any>;

        /* internal */ /* var */_attrAddTxtArray: Array<any>;

        /* internal */ /* var */_attrLabelTxtArray: Array<any>;

        /* internal */ /* var */_raiseArray: Array<any>;

        /* internal */ /* var */_labelTextFormat: GTextFormat;

        /* internal */ /* var */_valueTextFormat: GTextFormat;

        /* internal */ /* var */_addTextFormat: GTextFormat;
    }
